Imports System.Drawing

Namespace Overlay.Series
    ''' <summary>
    ''' The PieSeries object represents a slice of a pie displayed with the jChart.PieOverLay object.
    ''' </summary>
    ''' <remarks></remarks>
    Public Class PieSeries
        Implements iSeries

        Protected msName As String
        Protected moColor As Color
        Protected msnOpacity As Single = 1

        Protected msnValue As Single
        Protected msnPercent As Single

        Protected miOffset As Integer

        Protected mbShowSlice As Boolean = True
        Protected mbShowValue As Boolean = True

        Public Sub New()

        End Sub

        ''' <summary>
        ''' Value is an value of type Single that represents the value of a single slice in the pie.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Value() As Single
            Get
                Return msnValue
            End Get
            Set(ByVal value As Single)
                msnValue = value
            End Set
        End Property

        Friend Property Percent() As Single
            Get
                Return msnPercent
            End Get
            Set(ByVal value As Single)
                msnPercent = value
            End Set
        End Property

        ''' <summary>
        ''' The name of the series
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Name() As String _
            Implements iSeries.Name

            Get
                Return msName
            End Get
            Set(ByVal value As String)
                msName = value
            End Set
        End Property

        ''' <summary>
        ''' Indicates whether a slice should be displayed. False if the slice should not be displayed.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks>Defaults to True</remarks>
        Public Property ShowSlice() As Boolean
            Get
                Return mbShowSlice
            End Get
            Set(ByVal value As Boolean)
                mbShowSlice = value
            End Set
        End Property

        ''' <summary>
        ''' Indicates whether a label value should be displayed for this slice.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property ShowValue() As Boolean
            Get
                Return mbShowValue
            End Get
            Set(ByVal value As Boolean)
                mbShowValue = value
            End Set
        End Property

        ''' <summary>
        ''' The amount of offset for the series. Use this property to highlight a 
        ''' series by increasing or decreasing just the radius for the single pie slice.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Offset() As Integer
            Get
                Return miOffset
            End Get
            Set(ByVal value As Integer)
                miOffset = value
            End Set
        End Property

        ''' <summary>
        ''' The color of the series
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Color() As Color _
            Implements iSeries.Color

            Get
                Return moColor
            End Get
            Set(ByVal value As Color)
                moColor = value
            End Set
        End Property

        ''' <summary>
        ''' The amount of transparency of the series. A value of 1 is opaque and a value of 0 is transparent.
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property Opacity() As Single _
            Implements iSeries.Opacity

            Get
                Return msnOpacity
            End Get
            Set(ByVal value As Single)
                msnOpacity = value
            End Set
        End Property

        Friend ReadOnly Property AlphaValue() As Integer
            Get
                Return msnOpacity * 255
            End Get
        End Property
    End Class
End Namespace